1. Field of the Invention
The present invention relates to a code reader and code reading method for reading a hole code. More particularly, the present invention relates to a code reader and code reading method in which an object to be handled in an apparatus is provided with a hole code for representing information of the object, and in which the hole code is read for checking the object.
2. Description Related to the Prior Art
It is necessary in a thermal printer to use a certain type of thermosensitive recording material acceptable to settings of the thermal printer, because the imaging density is determined according to heating characteristics of a thermal head and coloring characteristics of the recording material. There is a roll recording material in which the recording material in a continuous shape is wound about a winding core in a cylindrical shape. The roll recording material has information printed on either of end surfaces of the winding core. The information represents a type, coloring characteristics, a manufacturer""s name of the roll recording material. Any kind of the information is encoded, and read by a code reader provided in the thermal printer at the time of starting the use of the roll recording material in the thermal printer. If the type and the like of the recording material is detected acceptable, the thermal printer is enabled to operate. If not, a display panel is caused to indicate an error, and the thermal head is disabled to operate even upon inputting of a start command signal.
A bar code is well known in the art of codes to represent information of various kinds, and consists of a combination of black and white bars arranged in a serial form. Also, a hole code is known, and consists of holes arranged serially and formed with a regular depth with reference to a reference surface. In a code reader for the hole code, a distance measuring sensor is incorporated, and has a distance measuring range covering the reference surface and a base face of the holes. The reference surface and the base face of the holes are both white. The reference surface and holes are discerned according to distances detected by the distance measuring sensor.
However, the distance measuring sensor is remarkably expensive. There is a problem in raising the cost of the code reader.
If a certain user intends to use the roll recording material of a type different from the genuine type, he or she may attach white paper to a portion including the holes to work the hole code fraudulently. With such a worked roll recording material, the distance measuring sensor is likely to judge that the holes with the white paper is the reference surface. There is no known technique for coping with such a fraud in the conventionally used code reader.
In view of the foregoing problems, an object of the present invention is to provide a code reader and code reading method for reading a hole code in which fraudulent working of a hole code can be detected reliably even with a simple construction.
In order to achieve the above and other objects and advantages of this invention, a code reader is provided for reading a code from an object surface of an object, the object surface having a low reflectance, the code including plural holes formed in the object surface at a regular depth, and having a hole base face, the hole base face having a high reflectance. In the code reader, a code detecting photo sensor is set so as to adapt a detection distance thereof to the hole base face, for detecting the high reflectance from the hole base face, to read the holes. A code inspecting photo sensor is set so as to adapt a detection distance thereof to the object surface, for inspecting the object surface, the object being detected unacceptable if the code inspecting photo sensor detects the high reflectance from the object surface.
In a preferred embodiment, a sensor signal is generated from respectively the code detecting photo sensor and the code inspecting photo sensor, is at an effective detection level in response to detection of the high reflectance at the detection distance, and is at a non-detection level when in a non-detection state without the detection of the high reflectance at the detection distance. Furthermore, a controller causes the code inspecting photo sensor to check the object surface in a direction of arranging the plural holes, and detects the object acceptable if the sensor signal from the code inspecting photo sensor is kept at the non-detection level continuously while the object surface is checked, to retrieve the sensor signal from the code detecting photo sensor.
The code inspecting photo sensor and the code detecting photo sensor respectively include a light projector element for projecting a sensor beam to the object surface or the hole base face. A light receiver element detects the high reflectance upon receiving the sensor beam reflected by the object surface or the hole base face, and for outputting the sensor signal at the effective detection level.
Furthermore, a binarizing circuit compares the sensor signal from the code inspecting photo sensor and the code detecting photo sensor with a reference level, and judges that the sensor signal is at the non-detection level if at a level lower than the reference level, and is at the effective detection level if at a level equal to or higher than the reference level.
The object has a cylindrical shape, and the object surface is an end surface of the object. The hole arranging direction is a rotational direction and defined along an arc about a center of the end surface. Furthermore, a rotating mechanism rotates the object in the hole arranging direction. The controller detects the end surface acceptable if the sensor signal from the code inspecting photo sensor is kept at the non-detection level during one rotation of the object.
The code inspecting photo sensor and the code detecting photo sensor respectively include a light projector lens for focusing the sensor beam on the object surface or the hole base face. A light receiver lens focuses on the light receiver element the sensor beam being reflected.
The object is a winding core for winding continuous sheet material thereabout.
The object surface is black, and the hole base face is white.
According to another aspect of the present invention, a code reader reads a code from an object surface of an object, the code including plural holes formed in the object surface at a regular depth, and having a hole base face, the hole base face having a high reflectance. In the code reader, a photo sensor is set so as to adapt a detection distance thereof to the hole base face, for outputting a sensor signal, the sensor signal being at an effective detection level in response to detection of the hole base face in the photo sensor, and being at a non-detection level when in a non-detection state in the photo sensor without the detection of the hole base face.
In a preferred embodiment, a controller causes the photo sensor to check the object surface in a direction of arranging the plural holes, and detects the object unacceptable if the sensor signal is kept at the non-detection level continuously while the object surface is checked.
The object surface has the high reflectance. When the photo sensor is opposed to a portion of the object surface offset from the holes, the sensor signal is at the non-detection level.
The photo sensor includes a light projector element for projecting a sensor beam to the hole base face. A light receiver element outputs the sensor signal at the effective detection level upon receiving the sensor beam reflected by the hole base face.
Furthermore, a binarizing circuit compares the sensor signal with a reference level, and judges that the sensor signal is at the non-detection level if at a level lower than the reference level, and is at the effective detection level if at a level equal to or higher than the reference level.
The object has a cylindrical shape, and the object surface is an end surface of the object. The hole arranging direction is a rotational direction and defined along an arc about a center of the end surface. Furthermore, a rotating mechanism rotates the object in the hole arranging direction. The controller detects the end surface unacceptable if the sensor signal is kept at the non-detection level during one rotation of the object.
The object surface and the hole base face are white.